<template>
	<view class="content">
		<!-- 	<uni-section title="姓名" sub-title="" type="line">
			{{data.name}}
		</uni-section>
		<uni-section title="邮箱" sub-title="" type="line" >
			{{data.email}}
		</uni-section>
		<uni-section title="电话" sub-title="" type="line">
			{{data.telephone}}
		</uni-section>
		<uni-section title="院系" sub-title="" type="line">
			{{data.department}}
		</uni-section>
		<uni-section title="专业" sub-title="" type="line">
			{{data.major}}
		</uni-section> -->
		<!-- <uni-forms ref="form" :rules="{}">
			<uni-forms-item label="姓名:" name="">
				<text class="title">{{data.name}}</text>
			</uni-forms-item>
		</uni-forms> -->
		<view>
			<image class="iamge" src="../../static/head/2.jpg" mode=""></image>
		</view>
		<view class="title">
			<view class="title-text">
				姓名：&nbsp;{{data.name}}
			</view>
			<view class="title-text">
				学院：&nbsp;{{data.department}}
			</view>
			<view class="title-text">
				专业：&nbsp;{{data.major}}
			</view>
			<view class="title-text">
				电话：&nbsp;{{data.telephone}}
			</view>
			<view class="title-text">
				邮箱：&nbsp;{{data.email}}
			</view>
		</view>
		<button class="button" @click="todeliver(data.name)" type="primary" style="width: 90%;">去评论</button>
		<button class="but" @click="seecomment(data.name)" type="primary" style="width: 90%;">查看评论</button>
	</view>

</template>

<script>
	export default {
		data() {
			return {
				data: {},
				id: -1
			}
		},
		methods: {
			todeliver(name){
				uni.navigateTo({
					url:"../classcomment/classcomment?name="+name
				})
			},
			seecomment(name){
				uni.navigateTo({
					url:"../classcomment/seeclasscomment?name="+name
				})
			}
		},
		onLoad(e) {
			this.id = e.id
			// console.log(this.id);
			uni.request({
				url: 'http://localhost:8090/freshmenapp/classmate/findone',
				method: 'POST',
				data: {
					id: this.id
				},
				success: res => {
					console.log(res);
					if (res.data.success == true) {
						this.data = res.data.data
						// console.log(res);
					}
				},
				fail: () => {},
				complete: () => {}
			});
		}
	}
</script>

<style>
	page{
		background-color: aliceblue;
	}
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		width: 100%;
		height: 100%;
		
	}

	.title {
		top: 100rpx;
	}
	.title .title-text{
		margin-top: 20rpx;
	}

	.iamge {
		width: 200rpx;
		height: 200rpx;
		border-radius: 50%;
		margin: 50rpx;
	}
	.button{
		position: fixed;
		bottom: 0;
		margin-bottom: 120rpx;
	}
	.but{
		position: fixed;
		bottom: 0;
		margin-bottom: 20rpx;
	}
</style>